﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DrawChartImage;
using System.Linq;
using Maticsoft.DBUtility;
using MySql.Data.MySqlClient;
using EnvironmentManagerSystem.MODE;

namespace EnvironmentManagerSystem.A
{
    /// <summary>
    /// 柱形类
    /// </summary>
    public class Chart
    {
        private int width = 30;
        private int height = 150;
        private Color chartColor = Color.Yellow;
        private Color chartColor2;
        private string caption = "测试";
        private Color captionColor = Color.Red;
        private Font captionFont = new Font("宋体", 11);
        private Color borderColor = Color.Black;
        private bool colorType = true;
        private string bottomText = "ACCP";
        private Color bottomTextColor = Color.Black;
        private Font bottomTextFont = new Font("宋体", 11);

        /// <summary>
        /// 获取或设置柱形的宽度
        /// </summary>
        public int Width
        {
            get
            {
                return width;
            }
            set
            {
                width = value;
            }
        }
        /// <summary>
        /// 获取或设置柱形的高度
        /// </summary>
        public int Height
        {
            get
            {
                return height;
            }
            set
            {
                height = value;
            }
        }
        /// <summary>
        /// 设置柱形的颜色
        /// </summary>
        /// <param name="color">颜色</param>
        public void SetChartColor(Color color)
        {
            this.chartColor = color;
            colorType = true;
        }
        /// <summary>
        /// 设置柱形的颜色,使用自定的2种颜色和线性渐变来设置
        /// </summary>
        /// <param name="color1">颜色1</param>
        /// <param name="color2">颜色2</param>
        public void SetChartColor(Color color1, Color color2)
        {
            this.chartColor = color1;
            this.chartColor2 = color2;
            colorType = false;
        }
        /// <summary>
        /// 判断柱形的颜色是用的1种还是2种来填充的,默认为1种返回true
        /// </summary>
        public bool ColorType
        {
            get
            {
                return colorType;
            }
        }

        /// <summary>
        /// 获取或设置柱形的标题文字
        /// </summary>
        public string Caption
        {
            get
            {
                return caption;
            }
            set
            {
                caption = value;
            }
        }
        /// <summary>
        /// 获取柱形的颜色
        /// </summary>
        public Color ChartColor
        {
            get
            {
                return chartColor;
            }
        }
        /// <summary>
        /// 如果柱形颜色有2种,则获取它的第2种颜色
        /// </summary>
        public Color ChartColor2
        {
            get
            {
                return chartColor2;
            }
        }
        /// <summary>
        /// 获取或设置标题文字的颜色
        /// </summary>
        public Color CaptionColor
        {
            get
            {
                return captionColor;
            }
            set
            {
                captionColor = value;
            }
        }
        /// <summary>
        /// 获取或设置标题文字的字体
        /// </summary>
        public Font CaptionFont
        {
            get
            {
                return captionFont;
            }
            set
            {
                captionFont = value;
            }
        }
        /// <summary>
        /// 获取或设置柱形的边框颜色
        /// </summary>
        public Color BorderColor
        {
            get
            {
                return borderColor;
            }
            set
            {
                borderColor = value;
            }
        }
        /// <summary>
        /// 获取或设置柱形的底部文本
        /// </summary>
        public string BottomText
        {
            get
            {
                return bottomText;
            }
            set
            {
                bottomText = value;
            }
        }
        /// <summary>
        /// 获取或设置柱形的底部文本颜色
        /// </summary>
        public Color BottomTextColor
        {
            get
            {
                return bottomTextColor;
            }
            set
            {
                bottomTextColor = value;
            }
        }
        /// <summary>
        /// 获取或设置柱形的底部文本字体
        /// </summary>
        public Font BottomTextFont
        {
            get
            {
                return bottomTextFont;
            }
            set
            {
                bottomTextFont = value;
            }
        }
    }
}
